// 只允许是商家显示某些按钮
import store from '@/store/index.js'

export default {
  // 插入 el 当前dom标签
  inserted(el, binding, vnode) {
    const usertype = store.getters && store.getters.usertype
    // 如果不是商家
    if (usertype !== 1) {
      // 移出这个dom节点
      // <el-button   v-permission   id="test">   https://www.runoob.com/jsref/prop-node-parentnode.html

      el.parentNode && el.parentNode.removeChild(el)
    }
  }
}
